<%@ page language="java" import="java.util.*, com.zjut.an.news.manager.*, com.zjut.an.news.dao.*, com.zjut.an.webclass.manager.*, com.zjut.an.webclass.dao.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,com.zjut.an.util.page.*,com.zjut.an.util.module.*,com.zjut.an.adplace.manager.*, com.zjut.an.ad.manager.*,com.zjut.an.adplace.dao.*, com.zjut.an.ad.dao.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>招生报名系统</title>
	<script src="css/tailwindcss.css"></script>
    <style>
        .content-area { line-height: 1.8; }
        .content-area h2 { font-size: 1.5rem; font-weight: bold; margin: 1.5rem 0 1rem 0; }
        .content-area h3 { font-size: 1.25rem; font-weight: bold; margin: 1.25rem 0 0.75rem 0; }
        .content-area p { margin-bottom: 1rem; }
        .content-area ul, .content-area ol { margin: 1rem 0; padding-left: 2rem; }
        .content-area li { margin-bottom: 0.5rem; }
    </style>
</head>
<%
HTMLCreat html = (HTMLCreat) SpringContextUtil.getBean("HTMLCreat");
AnNewsManager manager = (AnNewsManager) SpringContextUtil.getBean("AnNewsManager");
AnWebclassManager wcmanager = (AnWebclassManager) SpringContextUtil.getBean("AnWebclassManager");
AnAdManager admanager = (AnAdManager) SpringContextUtil.getBean("AnAdManager");
int neId = Integer.parseInt(request.getParameter("neId"));
AnNews news = manager.getData(neId);
if(null!=news.getHit())news.setHit(news.getHit()+1);else news.setHit(1);
manager.updateData(news);
AnWebclass webclass = news.getAnWebclass();
 %>
<body class="bg-gray-50 min-h-screen">
    <div class="max-w-6xl mx-auto px-4 py-8">

        <!-- 主要内容 -->
        <div class="bg-white rounded-xl shadow-sm">
            <!-- 公告标题和基本信息 -->
            <div class="border-b border-gray-200 p-8">
				<!-- 返回链接 -->
				<div class="mb-6">
					<a href="zs_newsclass.jsp?wcId=<%=webclass.getWcId() %>"
					   class="inline-flex items-center text-blue-600 hover:text-blue-800 hover:underline transition-colors duration-200 text-sm font-medium">
						<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
							<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
						</svg>
						返回列表
					</a>
				</div>
				<div class="flex flex-wrap items-center gap-4 mb-4 justify-end">
				    <span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">
				        <%=webclass.getWcName() %>
				    </span>
				    <span class="text-gray-500 text-sm">
				        来源：<%=news.getAuthor() %>
				    </span>
				    <span class="text-gray-500 text-sm">
				        发布日期：<%=news.getAdddate() %>
				    </span>
				    <span class="text-gray-500 text-sm">
				        浏览次数：<%=news.getHit() %>
				    </span>
				</div>

				<h1 class="text-3xl font-bold text-gray-900 mb-6 leading-tight text-center">
				    <%=news.getTitle() %>
				</h1>
            </div>

            <!-- 公告内容 -->
            <div class="p-8">
                <div class="content-area text-gray-700 prose prose-lg max-w-none">
                    <%=news.getNeContent() %>
                </div>
            </div>
        </div>


    </div>

    <script>
        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 为内容区域中的链接添加样式
            const contentLinks = document.querySelectorAll('.content-area a');
            contentLinks.forEach(link => {
                link.classList.add('text-blue-600', 'hover:text-blue-800', 'hover:underline');
            });

            // 为内容区域中的表格添加样式
            const contentTables = document.querySelectorAll('.content-area table');
            contentTables.forEach(table => {
                table.classList.add('w-full', 'border-collapse', 'border', 'border-gray-300');
                const thCells = table.querySelectorAll('th');
                thCells.forEach(th => {
                    th.classList.add('bg-gray-100', 'border', 'border-gray-300', 'px-4', 'py-2', 'text-left');
                });
                const tdCells = table.querySelectorAll('td');
                tdCells.forEach(td => {
                    td.classList.add('border', 'border-gray-300', 'px-4', 'py-2');
                });
            });
        });
    </script>
</body>

</html>
